package utils;

import models.User;
import play.mvc.Http.Request;
import controllers.Application;

public class Key {
	public static int CACHE_EXPIRE_15MIN = 900; //15 min
	public static int CACHE_EXPIRE_30MIN = 1800; //30 min
	
	// session keys
	public static final String USER_ID = "userId";
	public static final String SHEET_ID = "sheetId";
	public static final String ROW_ID = "rowId";
	public static final String ATTACHMENT_ID = "attachmentId";
	public static final String OAUTH_STATE = "oauthState";
	
	// cache key
	public static final String SHEETS = "sheets";
	public static final String SHEET = "sheet";
	public static final String ATTACHMENT = "attachment";
	public static final String SHARES = "shares";
	

    public static String getCacheKey(Request request, String key) {
    	User user = Application.getLoginUser(request);
    	return key+"-"+user.userId;
    }
    
    public static String getCacheKey(User user, String key) {
    	return key+"-"+user.userId;
    }
}
